3.5.54 \(\int \frac {(f+g x) (a+b \log (c x^n))}{(d+e x)^3} \, dx\) [454]

3.5.54.1 Optimal result
3.5.54.2 Mathematica [A] (verified)
3.5.54.3 Rubi [A] (verified)
3.5.54.4 Maple [B] (verified)
3.5.54.5 Fricas [B] (verification not implemented)
3.5.54.6 Sympy [B] (verification not implemented)
3.5.54.7 Maxima [B] (verification not implemented)
3.5.54.8 Giac [A] (verification not implemented)
3.5.54.9 Mupad [B] (verification not implemented)

3.5.54.1 Optimal result

Integrand size = 23, antiderivative size = 115 \[ \int \frac {(f+g x) \left (a+b \log \left (c x^n\right )\right )}{(d+e x)^3} \, dx=\frac {b (e f-d g) n}{2 d e^2 (d+e x)}+\frac {b f^2 n \log (x)}{2 d^2 (e f-d g)}-\frac {(f+g x)^2 \left (a+b \log \left (c x^n\right )\right )}{2 (e f-d g) (d+e x)^2}-\frac {b (e f+d g) n \log (d+e x)}{2 d^2 e^2} \]

output
1/2*b*(-d*g+e*f)*n/d/e^2/(e*x+d)+1/2*b*f^2*n*ln(x)/d^2/(-d*g+e*f)-1/2*(g*x 
+f)^2*(a+b*ln(c*x^n))/(-d*g+e*f)/(e*x+d)^2-1/2*b*(d*g+e*f)*n*ln(e*x+d)/d^2 
/e^2
 
3.5.54.2 Mathematica [A] (verified)

Time = 0.11 (sec) , antiderivative size = 108, normalized size of antiderivative = 0.94 \[ \int \frac {(f+g x) \left (a+b \log \left (c x^n\right )\right )}{(d+e x)^3} \, dx=\frac {-\frac {(e f-d g) \left (a+b \log \left (c x^n\right )\right )}{(d+e x)^2}-\frac {2 g \left (a+b \log \left (c x^n\right )\right )}{d+e x}+\frac {2 b g n (\log (x)-\log (d+e x))}{d}+\frac {b (e f-d g) n \left (\frac {d}{d+e x}+\log (x)-\log (d+e x)\right )}{d^2}}{2 e^2} \]

input
Integrate[((f + g*x)*(a + b*Log[c*x^n]))/(d + e*x)^3,x]
 
output
(-(((e*f - d*g)*(a + b*Log[c*x^n]))/(d + e*x)^2) - (2*g*(a + b*Log[c*x^n]) 
)/(d + e*x) + (2*b*g*n*(Log[x] - Log[d + e*x]))/d + (b*(e*f - d*g)*n*(d/(d 
 + e*x) + Log[x] - Log[d + e*x]))/d^2)/(2*e^2)
 
3.5.54.3 Rubi [A] (verified)

Time = 0.29 (sec) , antiderivative size = 113, normalized size of antiderivative = 0.98, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {2798, 99, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {(f+g x) \left (a+b \log \left (c x^n\right )\right )}{(d+e x)^3} \, dx\)

\(\Big \downarrow \) 2798

\(\displaystyle \frac {b n \int \frac {(f+g x)^2}{x (d+e x)^2}dx}{2 (e f-d g)}-\frac {(f+g x)^2 \left (a+b \log \left (c x^n\right )\right )}{2 (d+e x)^2 (e f-d g)}\)

\(\Big \downarrow \) 99

\(\displaystyle \frac {b n \int \left (\frac {f^2}{d^2 x}+\frac {d^2 g^2-e^2 f^2}{d^2 e (d+e x)}-\frac {(d g-e f)^2}{d e (d+e x)^2}\right )dx}{2 (e f-d g)}-\frac {(f+g x)^2 \left (a+b \log \left (c x^n\right )\right )}{2 (d+e x)^2 (e f-d g)}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {b n \left (-\left (\frac {f^2}{d^2}-\frac {g^2}{e^2}\right ) \log (d+e x)+\frac {f^2 \log (x)}{d^2}+\frac {(e f-d g)^2}{d e^2 (d+e x)}\right )}{2 (e f-d g)}-\frac {(f+g x)^2 \left (a+b \log \left (c x^n\right )\right )}{2 (d+e x)^2 (e f-d g)}\)

input
Int[((f + g*x)*(a + b*Log[c*x^n]))/(d + e*x)^3,x]
 
output
-1/2*((f + g*x)^2*(a + b*Log[c*x^n]))/((e*f - d*g)*(d + e*x)^2) + (b*n*((e 
*f - d*g)^2/(d*e^2*(d + e*x)) + (f^2*Log[x])/d^2 - (f^2/d^2 - g^2/e^2)*Log 
[d + e*x]))/(2*(e*f - d*g))
 

3.5.54.3.1 Defintions of rubi rules used

rule 99
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_) 
)^(p_), x_] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*x)^n*(e + f*x)^p, x], 
 x] /; FreeQ[{a, b, c, d, e, f, p}, x] && IntegersQ[m, n] && (IntegerQ[p] | 
| (GtQ[m, 0] && GeQ[n, -1]))
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 2798
Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_) + (e_.)*(x_))^(q_)*(( 
f_) + (g_.)*(x_))^(m_.), x_Symbol] :> Simp[(f + g*x)^(m + 1)*(d + e*x)^(q + 
 1)*((a + b*Log[c*x^n])^p/((q + 1)*(e*f - d*g))), x] - Simp[b*n*(p/((q + 1) 
*(e*f - d*g)))   Int[(f + g*x)^(m + 1)*(d + e*x)^(q + 1)*((a + b*Log[c*x^n] 
)^(p - 1)/x), x], x] /; FreeQ[{a, b, c, d, e, f, g, m, n, q}, x] && NeQ[e*f 
 - d*g, 0] && EqQ[m + q + 2, 0] && IGtQ[p, 0] && LtQ[q, -1]
 
3.5.54.4 Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(283\) vs. \(2(107)=214\).

Time = 0.68 (sec) , antiderivative size = 284, normalized size of antiderivative = 2.47

method result size
parallelrisch \(\frac {-b \,d^{3} g n -2 a \,d^{2} e f +2 \ln \left (x \right ) x^{2} b d \,e^{2} g n +b d \,e^{2} g n \,x^{2}-4 x \ln \left (c \,x^{n}\right ) b \,d^{2} e g +2 \ln \left (x \right ) x^{2} b \,e^{3} f n -2 \ln \left (e x +d \right ) b d \,e^{2} g n \,x^{2}-4 \ln \left (e x +d \right ) b \,d^{2} e g n x -4 \ln \left (e x +d \right ) b d \,e^{2} f n x +b \,d^{2} e f n -2 \ln \left (e x +d \right ) b \,d^{3} g n +2 \ln \left (x \right ) b \,d^{2} e f n -2 \ln \left (c \,x^{n}\right ) b \,d^{3} g -2 \ln \left (e x +d \right ) b \,e^{3} f n \,x^{2}-2 \ln \left (e x +d \right ) b \,d^{2} e f n +4 \ln \left (x \right ) x b \,d^{2} e g n +4 \ln \left (x \right ) x b d \,e^{2} f n +2 x^{2} a d \,e^{2} g -2 \ln \left (c \,x^{n}\right ) b \,d^{2} e f +2 \ln \left (x \right ) b \,d^{3} g n -b \,e^{3} f n \,x^{2}}{4 d^{2} e^{2} \left (e x +d \right )^{2}}\) \(284\)
risch \(-\frac {b \left (2 e g x +d g +e f \right ) \ln \left (x^{n}\right )}{2 \left (e x +d \right )^{2} e^{2}}+\frac {-2 b \,d^{2} e g n x +2 b d \,e^{2} f n x -i \pi b \,d^{3} g \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}+i \pi b \,d^{3} g \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )-i \pi b \,d^{2} e f \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}-2 b \,d^{3} g n -2 a \,d^{2} e f +2 \ln \left (-x \right ) b d \,e^{2} g n \,x^{2}+4 \ln \left (-x \right ) b \,d^{2} e g n x +4 \ln \left (-x \right ) b d \,e^{2} f n x -2 \ln \left (e x +d \right ) b d \,e^{2} g n \,x^{2}-4 \ln \left (e x +d \right ) b \,d^{2} e g n x -4 \ln \left (e x +d \right ) b d \,e^{2} f n x +i \pi b \,d^{3} g \operatorname {csgn}\left (i c \,x^{n}\right )^{3}+2 i \pi b \,d^{2} e g x \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )-4 a \,d^{2} e g x +2 b \,d^{2} e f n -2 \ln \left (c \right ) b \,d^{3} g -2 a \,d^{3} g -2 \ln \left (e x +d \right ) b \,d^{3} g n -2 \ln \left (c \right ) b \,d^{2} e f -i \pi b \,d^{3} g \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}+i \pi b \,d^{2} e f \operatorname {csgn}\left (i c \,x^{n}\right )^{3}+2 \ln \left (-x \right ) b \,d^{3} g n +2 \ln \left (-x \right ) b \,e^{3} f n \,x^{2}+2 \ln \left (-x \right ) b \,d^{2} e f n -2 \ln \left (e x +d \right ) b \,e^{3} f n \,x^{2}-2 \ln \left (e x +d \right ) b \,d^{2} e f n -i \pi b \,d^{2} e f \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}+2 i \pi b \,d^{2} e g x \operatorname {csgn}\left (i c \,x^{n}\right )^{3}-4 \ln \left (c \right ) b \,d^{2} e g x -2 i \pi b \,d^{2} e g x \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}-2 i \pi b \,d^{2} e g x \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}+i \pi b \,d^{2} e f \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )}{4 d^{2} e^{2} \left (e x +d \right )^{2}}\) \(624\)

input
int((g*x+f)*(a+b*ln(c*x^n))/(e*x+d)^3,x,method=_RETURNVERBOSE)
 
output
1/4*(-b*d^3*g*n-2*a*d^2*e*f+2*ln(x)*x^2*b*d*e^2*g*n+b*d*e^2*g*n*x^2-4*x*ln 
(c*x^n)*b*d^2*e*g+2*ln(x)*x^2*b*e^3*f*n-2*ln(e*x+d)*b*d*e^2*g*n*x^2-4*ln(e 
*x+d)*b*d^2*e*g*n*x-4*ln(e*x+d)*b*d*e^2*f*n*x+b*d^2*e*f*n-2*ln(e*x+d)*b*d^ 
3*g*n+2*ln(x)*b*d^2*e*f*n-2*ln(c*x^n)*b*d^3*g-2*ln(e*x+d)*b*e^3*f*n*x^2-2* 
ln(e*x+d)*b*d^2*e*f*n+4*ln(x)*x*b*d^2*e*g*n+4*ln(x)*x*b*d*e^2*f*n+2*x^2*a* 
d*e^2*g-2*ln(c*x^n)*b*d^2*e*f+2*ln(x)*b*d^3*g*n-b*e^3*f*n*x^2)/d^2/e^2/(e* 
x+d)^2
 
3.5.54.5 Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 215 vs. \(2 (107) = 214\).

Time = 0.28 (sec) , antiderivative size = 215, normalized size of antiderivative = 1.87 \[ \int \frac {(f+g x) \left (a+b \log \left (c x^n\right )\right )}{(d+e x)^3} \, dx=-\frac {a d^{2} e f + a d^{3} g - {\left (b d^{2} e f - b d^{3} g\right )} n + {\left (2 \, a d^{2} e g - {\left (b d e^{2} f - b d^{2} e g\right )} n\right )} x + {\left ({\left (b e^{3} f + b d e^{2} g\right )} n x^{2} + 2 \, {\left (b d e^{2} f + b d^{2} e g\right )} n x + {\left (b d^{2} e f + b d^{3} g\right )} n\right )} \log \left (e x + d\right ) + {\left (2 \, b d^{2} e g x + b d^{2} e f + b d^{3} g\right )} \log \left (c\right ) - {\left (2 \, b d e^{2} f n x + {\left (b e^{3} f + b d e^{2} g\right )} n x^{2}\right )} \log \left (x\right )}{2 \, {\left (d^{2} e^{4} x^{2} + 2 \, d^{3} e^{3} x + d^{4} e^{2}\right )}} \]

input
integrate((g*x+f)*(a+b*log(c*x^n))/(e*x+d)^3,x, algorithm="fricas")
 
output
-1/2*(a*d^2*e*f + a*d^3*g - (b*d^2*e*f - b*d^3*g)*n + (2*a*d^2*e*g - (b*d* 
e^2*f - b*d^2*e*g)*n)*x + ((b*e^3*f + b*d*e^2*g)*n*x^2 + 2*(b*d*e^2*f + b* 
d^2*e*g)*n*x + (b*d^2*e*f + b*d^3*g)*n)*log(e*x + d) + (2*b*d^2*e*g*x + b* 
d^2*e*f + b*d^3*g)*log(c) - (2*b*d*e^2*f*n*x + (b*e^3*f + b*d*e^2*g)*n*x^2 
)*log(x))/(d^2*e^4*x^2 + 2*d^3*e^3*x + d^4*e^2)
 
3.5.54.6 Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 908 vs. \(2 (100) = 200\).

Time = 2.37 (sec) , antiderivative size = 908, normalized size of antiderivative = 7.90 \[ \int \frac {(f+g x) \left (a+b \log \left (c x^n\right )\right )}{(d+e x)^3} \, dx=\begin {cases} \tilde {\infty } \left (- \frac {a f}{2 x^{2}} - \frac {a g}{x} - \frac {b f n}{4 x^{2}} - \frac {b f \log {\left (c x^{n} \right )}}{2 x^{2}} - \frac {b g n}{x} - \frac {b g \log {\left (c x^{n} \right )}}{x}\right ) & \text {for}\: d = 0 \wedge e = 0 \\\frac {a f x + \frac {a g x^{2}}{2} - b f n x + b f x \log {\left (c x^{n} \right )} - \frac {b g n x^{2}}{4} + \frac {b g x^{2} \log {\left (c x^{n} \right )}}{2}}{d^{3}} & \text {for}\: e = 0 \\\frac {- \frac {a f}{2 x^{2}} - \frac {a g}{x} - \frac {b f n}{4 x^{2}} - \frac {b f \log {\left (c x^{n} \right )}}{2 x^{2}} - \frac {b g n}{x} - \frac {b g \log {\left (c x^{n} \right )}}{x}}{e^{3}} & \text {for}\: d = 0 \\- \frac {a d^{3} g}{2 d^{4} e^{2} + 4 d^{3} e^{3} x + 2 d^{2} e^{4} x^{2}} - \frac {a d^{2} e f}{2 d^{4} e^{2} + 4 d^{3} e^{3} x + 2 d^{2} e^{4} x^{2}} - \frac {2 a d^{2} e g x}{2 d^{4} e^{2} + 4 d^{3} e^{3} x + 2 d^{2} e^{4} x^{2}} - \frac {b d^{3} g n \log {\left (\frac {d}{e} + x \right )}}{2 d^{4} e^{2} + 4 d^{3} e^{3} x + 2 d^{2} e^{4} x^{2}} - \frac {b d^{3} g n}{2 d^{4} e^{2} + 4 d^{3} e^{3} x + 2 d^{2} e^{4} x^{2}} - \frac {b d^{2} e f n \log {\left (\frac {d}{e} + x \right )}}{2 d^{4} e^{2} + 4 d^{3} e^{3} x + 2 d^{2} e^{4} x^{2}} + \frac {b d^{2} e f n}{2 d^{4} e^{2} + 4 d^{3} e^{3} x + 2 d^{2} e^{4} x^{2}} - \frac {2 b d^{2} e g n x \log {\left (\frac {d}{e} + x \right )}}{2 d^{4} e^{2} + 4 d^{3} e^{3} x + 2 d^{2} e^{4} x^{2}} - \frac {b d^{2} e g n x}{2 d^{4} e^{2} + 4 d^{3} e^{3} x + 2 d^{2} e^{4} x^{2}} - \frac {2 b d e^{2} f n x \log {\left (\frac {d}{e} + x \right )}}{2 d^{4} e^{2} + 4 d^{3} e^{3} x + 2 d^{2} e^{4} x^{2}} + \frac {b d e^{2} f n x}{2 d^{4} e^{2} + 4 d^{3} e^{3} x + 2 d^{2} e^{4} x^{2}} + \frac {2 b d e^{2} f x \log {\left (c x^{n} \right )}}{2 d^{4} e^{2} + 4 d^{3} e^{3} x + 2 d^{2} e^{4} x^{2}} - \frac {b d e^{2} g n x^{2} \log {\left (\frac {d}{e} + x \right )}}{2 d^{4} e^{2} + 4 d^{3} e^{3} x + 2 d^{2} e^{4} x^{2}} + \frac {b d e^{2} g x^{2} \log {\left (c x^{n} \right )}}{2 d^{4} e^{2} + 4 d^{3} e^{3} x + 2 d^{2} e^{4} x^{2}} - \frac {b e^{3} f n x^{2} \log {\left (\frac {d}{e} + x \right )}}{2 d^{4} e^{2} + 4 d^{3} e^{3} x + 2 d^{2} e^{4} x^{2}} + \frac {b e^{3} f x^{2} \log {\left (c x^{n} \right )}}{2 d^{4} e^{2} + 4 d^{3} e^{3} x + 2 d^{2} e^{4} x^{2}} & \text {otherwise} \end {cases} \]

input
integrate((g*x+f)*(a+b*ln(c*x**n))/(e*x+d)**3,x)
 
output
Piecewise((zoo*(-a*f/(2*x**2) - a*g/x - b*f*n/(4*x**2) - b*f*log(c*x**n)/( 
2*x**2) - b*g*n/x - b*g*log(c*x**n)/x), Eq(d, 0) & Eq(e, 0)), ((a*f*x + a* 
g*x**2/2 - b*f*n*x + b*f*x*log(c*x**n) - b*g*n*x**2/4 + b*g*x**2*log(c*x** 
n)/2)/d**3, Eq(e, 0)), ((-a*f/(2*x**2) - a*g/x - b*f*n/(4*x**2) - b*f*log( 
c*x**n)/(2*x**2) - b*g*n/x - b*g*log(c*x**n)/x)/e**3, Eq(d, 0)), (-a*d**3* 
g/(2*d**4*e**2 + 4*d**3*e**3*x + 2*d**2*e**4*x**2) - a*d**2*e*f/(2*d**4*e* 
*2 + 4*d**3*e**3*x + 2*d**2*e**4*x**2) - 2*a*d**2*e*g*x/(2*d**4*e**2 + 4*d 
**3*e**3*x + 2*d**2*e**4*x**2) - b*d**3*g*n*log(d/e + x)/(2*d**4*e**2 + 4* 
d**3*e**3*x + 2*d**2*e**4*x**2) - b*d**3*g*n/(2*d**4*e**2 + 4*d**3*e**3*x 
+ 2*d**2*e**4*x**2) - b*d**2*e*f*n*log(d/e + x)/(2*d**4*e**2 + 4*d**3*e**3 
*x + 2*d**2*e**4*x**2) + b*d**2*e*f*n/(2*d**4*e**2 + 4*d**3*e**3*x + 2*d** 
2*e**4*x**2) - 2*b*d**2*e*g*n*x*log(d/e + x)/(2*d**4*e**2 + 4*d**3*e**3*x 
+ 2*d**2*e**4*x**2) - b*d**2*e*g*n*x/(2*d**4*e**2 + 4*d**3*e**3*x + 2*d**2 
*e**4*x**2) - 2*b*d*e**2*f*n*x*log(d/e + x)/(2*d**4*e**2 + 4*d**3*e**3*x + 
 2*d**2*e**4*x**2) + b*d*e**2*f*n*x/(2*d**4*e**2 + 4*d**3*e**3*x + 2*d**2* 
e**4*x**2) + 2*b*d*e**2*f*x*log(c*x**n)/(2*d**4*e**2 + 4*d**3*e**3*x + 2*d 
**2*e**4*x**2) - b*d*e**2*g*n*x**2*log(d/e + x)/(2*d**4*e**2 + 4*d**3*e**3 
*x + 2*d**2*e**4*x**2) + b*d*e**2*g*x**2*log(c*x**n)/(2*d**4*e**2 + 4*d**3 
*e**3*x + 2*d**2*e**4*x**2) - b*e**3*f*n*x**2*log(d/e + x)/(2*d**4*e**2 + 
4*d**3*e**3*x + 2*d**2*e**4*x**2) + b*e**3*f*x**2*log(c*x**n)/(2*d**4*e...
 
3.5.54.7 Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 218 vs. \(2 (107) = 214\).

Time = 0.20 (sec) , antiderivative size = 218, normalized size of antiderivative = 1.90 \[ \int \frac {(f+g x) \left (a+b \log \left (c x^n\right )\right )}{(d+e x)^3} \, dx=\frac {1}{2} \, b f n {\left (\frac {1}{d e^{2} x + d^{2} e} - \frac {\log \left (e x + d\right )}{d^{2} e} + \frac {\log \left (x\right )}{d^{2} e}\right )} - \frac {1}{2} \, b g n {\left (\frac {1}{e^{3} x + d e^{2}} + \frac {\log \left (e x + d\right )}{d e^{2}} - \frac {\log \left (x\right )}{d e^{2}}\right )} - \frac {{\left (2 \, e x + d\right )} b g \log \left (c x^{n}\right )}{2 \, {\left (e^{4} x^{2} + 2 \, d e^{3} x + d^{2} e^{2}\right )}} - \frac {{\left (2 \, e x + d\right )} a g}{2 \, {\left (e^{4} x^{2} + 2 \, d e^{3} x + d^{2} e^{2}\right )}} - \frac {b f \log \left (c x^{n}\right )}{2 \, {\left (e^{3} x^{2} + 2 \, d e^{2} x + d^{2} e\right )}} - \frac {a f}{2 \, {\left (e^{3} x^{2} + 2 \, d e^{2} x + d^{2} e\right )}} \]

input
integrate((g*x+f)*(a+b*log(c*x^n))/(e*x+d)^3,x, algorithm="maxima")
 
output
1/2*b*f*n*(1/(d*e^2*x + d^2*e) - log(e*x + d)/(d^2*e) + log(x)/(d^2*e)) - 
1/2*b*g*n*(1/(e^3*x + d*e^2) + log(e*x + d)/(d*e^2) - log(x)/(d*e^2)) - 1/ 
2*(2*e*x + d)*b*g*log(c*x^n)/(e^4*x^2 + 2*d*e^3*x + d^2*e^2) - 1/2*(2*e*x 
+ d)*a*g/(e^4*x^2 + 2*d*e^3*x + d^2*e^2) - 1/2*b*f*log(c*x^n)/(e^3*x^2 + 2 
*d*e^2*x + d^2*e) - 1/2*a*f/(e^3*x^2 + 2*d*e^2*x + d^2*e)
 
3.5.54.8 Giac [A] (verification not implemented)

Time = 0.32 (sec) , antiderivative size = 199, normalized size of antiderivative = 1.73 \[ \int \frac {(f+g x) \left (a+b \log \left (c x^n\right )\right )}{(d+e x)^3} \, dx=-\frac {{\left (2 \, b e g n x + b e f n + b d g n\right )} \log \left (x\right )}{2 \, {\left (e^{4} x^{2} + 2 \, d e^{3} x + d^{2} e^{2}\right )}} + \frac {b e^{2} f n x - b d e g n x - 2 \, b d e g x \log \left (c\right ) + b d e f n - b d^{2} g n - 2 \, a d e g x - b d e f \log \left (c\right ) - b d^{2} g \log \left (c\right ) - a d e f - a d^{2} g}{2 \, {\left (d e^{4} x^{2} + 2 \, d^{2} e^{3} x + d^{3} e^{2}\right )}} - \frac {{\left (b e f n + b d g n\right )} \log \left (e x + d\right )}{2 \, d^{2} e^{2}} + \frac {{\left (b e f n + b d g n\right )} \log \left (x\right )}{2 \, d^{2} e^{2}} \]

input
integrate((g*x+f)*(a+b*log(c*x^n))/(e*x+d)^3,x, algorithm="giac")
 
output
-1/2*(2*b*e*g*n*x + b*e*f*n + b*d*g*n)*log(x)/(e^4*x^2 + 2*d*e^3*x + d^2*e 
^2) + 1/2*(b*e^2*f*n*x - b*d*e*g*n*x - 2*b*d*e*g*x*log(c) + b*d*e*f*n - b* 
d^2*g*n - 2*a*d*e*g*x - b*d*e*f*log(c) - b*d^2*g*log(c) - a*d*e*f - a*d^2* 
g)/(d*e^4*x^2 + 2*d^2*e^3*x + d^3*e^2) - 1/2*(b*e*f*n + b*d*g*n)*log(e*x + 
 d)/(d^2*e^2) + 1/2*(b*e*f*n + b*d*g*n)*log(x)/(d^2*e^2)
 
3.5.54.9 Mupad [B] (verification not implemented)

Time = 0.95 (sec) , antiderivative size = 174, normalized size of antiderivative = 1.51 \[ \int \frac {(f+g x) \left (a+b \log \left (c x^n\right )\right )}{(d+e x)^3} \, dx=-\frac {a\,d\,g+a\,e\,f+\frac {x\,\left (2\,a\,d\,e\,g-b\,e^2\,f\,n+b\,d\,e\,g\,n\right )}{d}+b\,d\,g\,n-b\,e\,f\,n}{2\,d^2\,e^2+4\,d\,e^3\,x+2\,e^4\,x^2}-\frac {\ln \left (c\,x^n\right )\,\left (\frac {b\,f}{2\,e}+\frac {b\,d\,g}{2\,e^2}+\frac {b\,g\,x}{e}\right )}{d^2+2\,d\,e\,x+e^2\,x^2}-\frac {b\,n\,\mathrm {atanh}\left (\frac {b\,n\,\left (d\,g+e\,f\right )\,\left (d+2\,e\,x\right )}{d\,\left (b\,d\,g\,n+b\,e\,f\,n\right )}\right )\,\left (d\,g+e\,f\right )}{d^2\,e^2} \]

input
int(((f + g*x)*(a + b*log(c*x^n)))/(d + e*x)^3,x)
 
output
- (a*d*g + a*e*f + (x*(2*a*d*e*g - b*e^2*f*n + b*d*e*g*n))/d + b*d*g*n - b 
*e*f*n)/(2*d^2*e^2 + 2*e^4*x^2 + 4*d*e^3*x) - (log(c*x^n)*((b*f)/(2*e) + ( 
b*d*g)/(2*e^2) + (b*g*x)/e))/(d^2 + e^2*x^2 + 2*d*e*x) - (b*n*atanh((b*n*( 
d*g + e*f)*(d + 2*e*x))/(d*(b*d*g*n + b*e*f*n)))*(d*g + e*f))/(d^2*e^2)